package su.jiedai.service;
import java.io.PrintWriter;
import java.sql.SQLException;
import java.util.List;
import java.util.Map;

import net.kuakao.core.exception.DataBaseException;

import org.springframework.ui.Model;

import su.jiedai.dto.JiedaiDto;
import su.jiedai.entity.JiedaiEntity;


public interface IJiedaiService {
	
	/**
	 * 借货信息分页查询
	 * @param jiedaiDto 借货信息Dto
	 * @return 借货信息列表
	 * @throws Exception
	 */
	public List<JiedaiEntity> queryJiedaiByPage(JiedaiDto jiedaiDto, Model model) throws Exception;
	
	/**
	 * 取全部借货数据
	 * @return
	 * @throws SQLException
	 */
	public List<JiedaiEntity> getAll(String year) throws SQLException;
	
	/**
	 * 统计数据
	 * @param year
	 * @return
	 * @throws SQLException
	 */
	public List<Map<String,Object>> getCountList(String year) throws SQLException;
	
	/**
	 * 查询单个借货信息对象
	 * @param jdId 借货信息id
	 * @return 借货信息
	 * @throws Exception
	 */
	public JiedaiEntity getJiedaiById(int jdId) throws Exception;
	
	
	/**
	 * 保存或更新借货信息
	 * @param jiedaiDto
	 * @throws Exception
	 */
	public void saveJiedai(JiedaiDto jiedaiDto, Model model) throws Exception;
	
	/**
	 * 删除借货信息
	 * @param jdId
	 * @param model
	 * @throws Exception
	 */
	public void destroyJiedai(int jdId) throws Exception;
	
	/**
	 * 处理Excel中的数据
	 * @param list
	 * @param out
	 * @throws DataBaseException
	 */
	public void operateExcelData(List<List<String[]>> list,PrintWriter out)throws DataBaseException;
	
	/**
	 * 全部删除
	 * @throws SQLException
	 */
	public void removeAll() throws SQLException;

}
